Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 speedup slowest e2e tests #3656

Merged
merged 3 commits into from
Nov 9, 2023

Conversation

spencerschrock
Copy link
Member

What kind of change does this PR introduce?

e2e test speedup

What is the current behavior?

Theres 2 tests which are 1-2 orders of magnitude slower than other e2e tests:

  • "Should return use of OSS-Fuzz"
    • tensorflow/tensorflow is a really big repo and this test downloads the repo.
  • "Should attest to repos based on policy"
    • this one runs scorecard repeatedly on the same repos

What is the new behavior (if this is a feature change)?**

  • "Should return use of OSS-Fuzz"

    • ossf/scorecard-webapp is a much smaller repo which is fuzzed by OSSFuzz
  • "Should attest to repos based on policy"

    • split into 3 smaller tests
      • Since only one test dealt with ossf-tests/scorecard-binauthz-test-good, I changed the existing test to just test this one.
      • for the other two repos ( ossf-tests/scorecard-binauthz-test-bad and ossf-tests/scorecard-attestor-code-review-e2e), I changed the tests so they only fetch the results once, and just test the various policies against it.
  • Tests for the changes have been added (for bug fixes/features)

Which issue(s) this PR fixes

NONE

Special notes for your reviewer

Does this PR introduce a user-facing change?

For user-facing changes, please add a concise, human-readable release note to
the release-note

(In particular, describe what changes users might need to make in their
application as a result of this pull request.)

NONE

tensorflow/tensorflow is huge, and this causes the test to take forever.
locally this reduces the test time from 17 to 2.4 seconds

Signed-off-by: Spencer Schrock <[email protected]>
previously this test took 27 seconds locally, and now takes 8.
which is split across 3 subtests:
good repos: 1s
bad repos: 5s
code review policies: 2s

Signed-off-by: Spencer Schrock <[email protected]>
@spencerschrock spencerschrock requested a review from a team as a code owner November 9, 2023 00:07
@spencerschrock spencerschrock requested review from laurentsimon and removed request for a team November 9, 2023 00:07
Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #3656 (ba98ffc) into main (0fc8296) will decrease coverage by 10.57%.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3656       +/-   ##
===========================================
- Coverage   76.13%   65.56%   -10.57%     
===========================================
  Files         206      206               
  Lines       14053    14053               
===========================================
- Hits        10699     9214     -1485     
- Misses       2726     4332     +1606     
+ Partials      628      507      -121     

@spencerschrock
Copy link
Member Author

The speedups based on this PR should hopefully save 1-2 minutes total for the integration tests. The overall test time has a lot of variation between 6-10 minutes, but there's usually more stability in the individual test time.

Before:
Attestor test: 61s
OssFuzz test: 86s

After:
Attestor tests: 11 seconds total, (split into 1, 8, and 2s)
OssFuzz test: 7 seconds

@spencerschrock spencerschrock enabled auto-merge (squash) November 9, 2023 17:42
@spencerschrock spencerschrock merged commit 2c959b7 into ossf:main Nov 9, 2023
38 checks passed
@spencerschrock spencerschrock deleted the e2e/fix-slow-tests branch November 9, 2023 17:50
diogoteles08 pushed a commit to diogoteles08/scorecard that referenced this pull request Nov 13, 2023
* switch ossfuzz test to smaller repo

tensorflow/tensorflow is huge, and this causes the test to take forever.
locally this reduces the test time from 17 to 2.4 seconds

Signed-off-by: Spencer Schrock <[email protected]>

* reuse scorecard results for scorecard attestor policies

previously this test took 27 seconds locally, and now takes 8.
which is split across 3 subtests:
good repos: 1s
bad repos: 5s
code review policies: 2s

Signed-off-by: Spencer Schrock <[email protected]>

---------

Signed-off-by: Spencer Schrock <[email protected]>
Signed-off-by: Diogo Teles Sant'Anna <[email protected]>
ashearin pushed a commit to kgangerlm/scorecard-gitlab that referenced this pull request Nov 13, 2023
* switch ossfuzz test to smaller repo

tensorflow/tensorflow is huge, and this causes the test to take forever.
locally this reduces the test time from 17 to 2.4 seconds

Signed-off-by: Spencer Schrock <[email protected]>

* reuse scorecard results for scorecard attestor policies

previously this test took 27 seconds locally, and now takes 8.
which is split across 3 subtests:
good repos: 1s
bad repos: 5s
code review policies: 2s

Signed-off-by: Spencer Schrock <[email protected]>

---------

Signed-off-by: Spencer Schrock <[email protected]>
Signed-off-by: Allen Shearin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants